package ltd.followkba.comment.edit;

/**
 * Created by Administrator on 2018/6/23.
 */

//public class CommHistoryActivity extends SkinActivity {
//    private byte gAppType;
//    private BTaskRun mBTaskRun;
//    private List<String> mDownload;
//
//    public static void startWithParamete(BTaskRun bTaskRun){
//        MBAPP.mSaveBTaskRun = bTaskRun;
//        MRAM.mActivity.startActivity(new Intent(MRAM.mActivity, CommHistoryActivity.class));
//    }
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState)	{
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.normal_list_activity);
//        mBTaskRun = MBAPP.mSaveBTaskRun;
//        gAppType = mBTaskRun.AppType;
//        MBAPP.mSaveBTaskRun = null;
//        initView();
//        initListView(findViewById(R.id.klvNormalList));
//        showInfo();
//    }
//    private void initView() {
//        mKcHeaderView = (KcHeaderView) findViewById(R.id.khvNormalList);
//        mKcHeaderView.setTitle(new KcTypeListener() {
//            @Override
//            public void onMessage(int type) {
//                switch (type) {
//                    case KcHeaderView.TYPE_CLICK_LEFT:
//                        finish();
//                        break;
//                }
//            }
//        });
//    }
//    private void showInfo(){
//        List<BOldCommDone> lists = (List) MBAPP.getCommDone(gAppType, mBTaskRun.OwnApp.gsUserID);
//        mKcHeaderView.setTitle(String.format("评论历史数据 (%d)", lists.size()));
//        sortTaskID(lists);
//        setListView((List) lists);
//    }
//    private void sortTaskID(List<BOldCommDone> lists){
//        if (lists != null) {
//            Collections.sort(lists, new Comparator<BOldCommDone>() {
//                public int compare(BOldCommDone info1, BOldCommDone info2) {
//                    if (info1 != null && info2 != null) {
//                        return info2.SetTick - info1.SetTick;  // 降序
//                    }
//                    return 0;
//                }
//            });
//        }
//    }
//
//    private static final int[] item_task_list = new int[]{
//            R.layout.item_old_task, 7,
//            R.id.tvLeft0Task, R.id.tvRight0Task,R.id.tvLeft1Task, R.id.tvRight1Task, R.id.tvLeft2Task, R.id.tvRight2Task,
//            R.id.kbiTaskAvatarView,
//    };
//
//    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//    // KcListView的全部处理，放在页面的最后位置统一处理 ///////////////////////////////////////////////////////////////////
//    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//    private KcListView mKcListView;
//    private void setListView(){
//        if (mKcListView != null) {
//            mKcListView.setData(true);
//        }
//    }
//    private void setListView(int position){
//        if (mKcListView != null) {
//            mKcListView.setData(position);
//        }
//    }
//    private void setListView(ABean aBean){
//        if (mKcListView != null) {
//            mKcListView.setData(aBean);
//        }
//    }
//    private void setListView(List<Object> list){
//        if (mKcListView != null) {
//            mKcListView.setData(list);
//        }
//    }
//    private void setSize(int length){
//        if (mKcListView != null) {
//            mKcListView.setSize(length);
//        }
//    }
//    public void setBusy(String text){
//        if (mKcListView != null) {
//            mKcListView.setBusy(text);
//        }
//    }
//    public void setTopView(){
//        if (mKcListView != null) {
//            mKcListView.mKcListAdapter.notifyItemChanged(0);
//        }
//    }
//    private Object getListView(int position){
//        return (mKcListView != null) ? mKcListView.getData(position) : 0;
//    }
//    private List<Object> getListView(){
//        return (mKcListView != null) ? mKcListView.getListBean() : new ArrayList<>();
//    }
//    private int getSize(){
//        return (mKcListView != null) ? mKcListView.getSize() : null;
//    }
//
//    private void initListView(final View view){
//        mKcListView = (KcListView)view;
//        LinearLayoutManager manager2 = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL,false);
//        mKcListView.initView(null, item_task_list, manager2, new KcListListener() {
//            @Override
//            public int onMessage(int type, int tab, Object object){
//                return 0;
//            }
//            @Override
//            public int onBindItemHolder(boolean skipImage, int tab, int position, KcListHolder holder) {
//                if (mKcListView.getSize() < 1){
//                    return 0;
//                }
//                BOldCommDone bCommDone = (BOldCommDone) getListView(position);
//                if (bCommDone != null){
//                    String fileName = String.format("%s%d_%s.jpg", MKCS.gsPhotoPath, gAppType, bCommDone.UserID);
//                    if (MAPI.GET_FILE_LENGTH(fileName) < 500){
//                        if (mDownload == null) {
//                            mDownload = new ArrayList<String>();
//                            new Thread(new Runnable() {
//                                @Override
//                                public void run() {
////                    MSTRING("CMultiThread setTask B "+isStopTask+" "+mKcTwoListener+" "+mLists);
//                                    MSLEEP(50);
//                                    while (mDownload.size() > 0) {
//                                        String gsLocal_1 = mDownload.get(0);
//                                        BUserInfo aUserInfo = mBTaskRun.OwnApp.GetUserFullInfo(gsLocal_1);
//                                        gsLocal_1 = mBTaskRun.OwnApp.downloadHeadFile(aUserInfo);
////                                        MSTRING("CMultiThread setTask C "+" "+gsLocal_1);
//                                        MRAM.mActivity.runOnUiThread(new Runnable() {
//                                            @Override
//                                            public void run() {
//                                                setListView();
//                                            }
//                                        });
//                                        mDownload.remove(0);
//                                    }
//                                    mDownload = null;
//                                }
//                            }).start();
//                        }
//                        mDownload.add(bCommDone.UserID);
//                    }else {
//                        MSTRING("CMultiThread setTask C "+ MAPI.GET_FILE_LENGTH(fileName)+" "+fileName);
//                        AdvBitmap.setBitmap(C3_FG_NORMAL | CROP_ROUND10, fileName, R.drawable.c3i_user_head, holder.mView[6]);
//                    }
//                    MSKIN.setText(bCommDone.UserName, holder.mView[0]);
//                    MSKIN.setText(mMyUtils.getSmartDate(bCommDone.SetTick), holder.mView[1]);
//                    MSKIN.setText(bCommDone.SongName, holder.mView[2]);
//                    MSKIN.setText(bCommDone.Source, holder.mView[3]);
//                    MSKIN.setText(bCommDone.Text, holder.mView[4]);
//                    MSKIN.setText(String.format("%d毫秒", bCommDone.RunTimer), holder.mView[5]);
//                }
//                return 0;
//            }
//        });
//        mKcListView.setStatus(false, false, "", "还没有历史数据", "");
//    }
//
//}
